/** activates output depending on whether the given Pawn has the specified inventory item */
class SeqCond_HasItem extends SequenceCondition;

/** player to look for inventory on */
var Actor Target;
/** inventory item to check */
var() inventory RequiredInventory;

event Activated()
{
	local Pawn P;
	local inventory item;
	local bool bHasItem;

	P = GetPawn(Target);
	if (P != None)
	{
		bHasItem = false;
		item = P.InvManager.InventoryChain;
		while(item != none)
		{
			if(item == RequiredInventory)
			{
				bHasItem = true;
				break;
			}
			item = item.inventory;
		}
		OutputLinks[bHasItem ? 0 : 1].bHasImpulse = true;
	}
}

defaultproperties
{
	ObjName="Has Item"
	VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Target,MinVars=1,MaxVars=1)
	OutputLinks[0]=(LinkDesc="Has Item")
	OutputLinks[1]=(LinkDesc="Doesn't Have Item")
}